package com.smbms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.smbms.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.Query;


public interface UserMapper extends BaseMapper<User> {

    IPage<User> selectUserPage(IPage<User> page,
                               @Param("userName") String userName,
                               @Param("userRole") int userRole);
    @Select("select u.* ,r.roleName as userRoleName from smbms_user as u,smbms_role as r where u.id=#{id}  and u.userRole=r.id")
    User getUserById(String id);
}


